<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<!-- ko if: $view().editable -->
<div
    class="action-dropdown-menu-item-edit">
    <input
        class="admin__control-text"
        data-bind="
            value: $view().value,
            hasFocus: isEditing($view().index),
            autoselect,
            attr: {
                placeholder: $view().label
            },
            keyboard: {
                13: updateAndSave.bind($data, $view().index),
                27: endEdit.bind($data, $view().index)
            }"
        type="text">
    <button
        class="action-submit"
        data-bind="
            attr: {
                title: $t('Save all changes')
            },
            click: updateAndSave.bind($data, $view().index)"
        type="button">
        <span data-bind="i18n: 'Submit'"></span>
    </button>
    <div class="action-dropdown-menu-item-actions">
        <button
            data-bind="
                attr: {
                    title: $t('Delete bookmark')
                },
                click: removeView.bind($data, $view().index)"
            class="action-delete"
            type="button">
            <span data-bind="i18n: 'Delete'"></span>
        </button>
    </div>
</div>
<!-- /ko -->

<div class="action-dropdown-menu-item">
    <a
        class="action-dropdown-menu-link"
        href=""
        data-bind="
            text: $view().label,
            click: applyView.bind($data, $view().index),
            closeCollapsible">
    </a>

    <!-- ko if: $view().editable -->
    <div class="action-dropdown-menu-item-actions">
        <button
            class="action-edit"
            data-bind="
                attr: {
                    title: $t('Edit bookmark')
                },
                click: editView.bind($data, $view().index)"
            type="button">
            <span data-bind="i18n: 'Edit'"></span>
        </button>
    </div>
    <!-- /ko -->
</div>
